package com.jiyun.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jiyun.pojo.ThOrder;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.jiyun.service.IThOrderService;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  成单表
 * </p>
 *
 * @author usian
 * @since 2022-10-25
 */
@RestController
@RequestMapping("/order")
@Api(tags = "接口")
@CrossOrigin
public class ThOrderController{

    @Autowired
    private IThOrderService thOrderService;

    /**
     * 龙虎榜单
     * @return
     */
    @GetMapping("/orderList")
    public Map<String,Object> orderList(){
        List<ThOrder> thOrders = thOrderService.orderByDESC();
        Map<String,Object> map=new HashMap<>();
        int i=0;
        for (ThOrder thOrder : thOrders) {
            i++;
            map.put("龙虎榜第"+i+"名",thOrder.getStoreName());
        }
        return map;
    }
}
